package com.learn.hibernatevalidator.chapter02.containerelement.map;

import jakarta.validation.constraints.NotNull;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: liyf
 * @create: 2024-12-20 22:37
 **/
public class Car {

    private Map<@NotNull FuelConsumption, @MaxAllowedFuelConsumption Integer> fuelConsumptions = new HashMap<>();

    public void setFuelConsumption(FuelConsumption fuelConsumption, int value) {
        fuelConsumptions.put(fuelConsumption, value);
    }


    public enum FuelConsumption {
        CITY,
        HIGHWAY
    }

}
